a = int(input())
n = int(input())
s = 0
for i in range(n):
    x = 0
    for j in range(i+1):
        x += a*10**j
    s += x
print(s)
